package com.macaline.technology.es;

public class ESIterator {

    private ESVo next = new ESVo();
    private ESVo lastNext = new ESVo();

    public ESIterator(ESVo esVo){
        this.next.addNext(esVo);
    }

    /**
     * 判断还有没有下一个元素
     * @return
     */
    public Boolean haveNext(){
        if(this.next.getNext() == null){
            return false;
        }
        return true;
    }

    /**
     * 获取节点
     * @return
     * @throws Exception
     */
    public ESVo next() throws Exception {
        this.lastNext = this.next;
        this.next = this.next.getNext();
        return this.next;
    }
}
